﻿CREATE PROCEDURE [dbo].[AddModelRoleAccess]
	@ModelRoleAccessId uniqueidentifier,
	@Model uniqueidentifier,
	@SecurityRole uniqueidentifier,
	@Person uniqueidentifier,
    @Permissions int,
	@CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO ModelRoleAccess

	(ModelRoleAccessId, Model, SecurityRole, Person, [Permissions], CreatedBy, CreatedOn, 
	LastChanged, LastChangedBy)

	VALUES 

	(@ModelRoleAccessId, @Model, @SecurityRole, @Person, @Permissions, @CreatedBy, @CreatedOn, 
	@LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM ModelRoleAccess WHERE ModelRoleAccessId=@ModelRoleAccessId

RETURN 0